import request from '../../utils/request'
import type { LoginParams, LoginResponse, UserInfoResponse } from './types'

// 用户登录接口
export const loginApi = (data: LoginParams): Promise<LoginResponse> => {
  return request({
    url: '/user/login',
    method: 'post',
    data,
  })
}

// 获取用户信息接口
export const getUserInfoApi = (): Promise<UserInfoResponse> => {
  return request({
    url: '/user/info',
    method: 'get',
  })
}
